// 查询字典
const cloud = require('wx-server-sdk');
cloud.init({
  env:cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
exports.main = async (event, context) =>{
  const res = await db.collection('dictList').get();
  const dictList = res.data; //所有的字典列表
  const obj = {};
  for(let i = 0; i<dictList.length;i++){
    obj[dictList[i]["dictType"]] = dictList[i].dictList;
  }
  return obj;
}